home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / IDLIncludes / HILists.idl < prev    next >
Text File  |  1996-05-01  |  7KB  |  264 lines

  1. /*
  2.      File:        HILists.idl
  3.  
  4.      Contains:    Interfaces to one-dimensional item layout objects: lists, multiple selection lists, and menus
  5.  
  6.      Version:    Technology:    System 8.0
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1995-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16. */
  17.  
  18.  
  19. #ifndef __HILISTS_IDL__
  20. #define __HILISTS_IDL__
  21.  
  22. #include <HIPanels.idl>
  23. #include <HIImagingObjects.idl>
  24. #include <HIItemStorage.idl>
  25. #include <HIListTypes.idl>
  26.  
  27.  
  28. interface HIAbstractList : HIPanel
  29. {
  30. // ======================================================
  31. // Public Methods
  32. // ======================================================
  33.  
  34.  
  35.     OSStatus    InitAbstractList(    in RefLabel        identifier,
  36.                                     in HIWindow     window, 
  37.                                     in Rect         bounds );            
  38.                                 
  39.  
  40.  
  41.     OSStatus    AddItems( in HIItemIndex index, in UInt32 numItems );                    
  42.                 // Adds empty rows to lists/menus
  43.     OSStatus    DeleteItem( in HIItemIndex index );                                        
  44.                 // Deletes the specified row from a list/menu; Also deletes the item data if any
  45.     
  46.     
  47.     OSStatus    SetItemImage( in HIItemIndex index, in ConstHIImageRef imageRef, 
  48.                                     in HIAdoptionFlags imageAdoptionFlags);    
  49.     OSStatus    GetItemImage( in HIItemIndex index, out HIImageRef imageRefPtr );
  50.  
  51.     
  52.  
  53.     OSStatus    SetItemMark( in HIItemIndex index, in UInt16 markChar );                    
  54.     UInt16        GetItemMark( in HIItemIndex index );                                        
  55.  
  56.  
  57.     OSStatus    SetItemIcon( in HIItemIndex index, in Handle iconSuite );                    
  58.     Handle        GetItemIcon( in HIItemIndex index );                                        
  59.  
  60.  
  61.  
  62.     OSStatus    SetItemChild( in HIItemIndex index, in HIAbstractList child );            
  63.     OSStatus    GetItemChild( in HIItemIndex index, out HIAbstractList child );            
  64.  
  65.  
  66.  
  67.     OSStatus    SetItemEnabledState( in HIItemIndex index, in HIItemState enableState );    
  68.                 // Enables/disables an item or any of its decorations (mark, icon, etc.).
  69.                 // New for lists. It wasn't really possible to disable list items without
  70.                 // writing your own LDEF.
  71.     HIItemState    GetItemEnabledState( in HIItemIndex index );                                
  72.  
  73.  
  74.  
  75.     OSStatus    SetItemAttributes( in HIItemIndex index, in HIItemAttributes attributes );    
  76.     HIItemAttributes    GetItemAttributes( in HIItemIndex index );    
  77.  
  78.  
  79.     OSStatus    SetItemRefLabel( in HIItemIndex index, in RefLabel identifier );    
  80.     OSStatus    GetItemRefLabel( in HIItemIndex index, out RefLabel identifier );    
  81.  
  82.  
  83.     UInt32        GetItemCount();                                                            
  84.                 // Returns the number of rows in a list/menu
  85.     
  86.     
  87.  
  88.  
  89.  
  90.     void        SelectItem( in HIItemIndex index );                                            
  91.     void        DeselectItem( in HIItemIndex index );                                    
  92.                 // Useful for single selection panels only like radio button groups, pop-up menus, single-selection lists, etc.
  93.     HIItemIndex    GetSelectedItem();                                                            
  94.                 // Useful for single selection panels only like radio button groups, pop-up menus, single-selection lists, etc.
  95.  
  96.  
  97.  
  98.     OSStatus    AddItemCollectionItem( in HIItemIndex index, in CollectionTag tag,
  99.                     in UInt32 dataSize, in void *data );                                    
  100.                 // For developer use exclusively. List/Menu panels completely ignore the contents of collection items;
  101.                 // These methods are just pass-throughs to the Collection Manager. 
  102.                 
  103.     OSStatus    GetItemCollectionItemData( in HIItemIndex index, in CollectionTag tag,
  104.                     in UInt32 dataSizeIn, out UInt32 dataSizeOut, in void *data );            
  105.                     
  106.     OSStatus    RemoveItemCollectionItem( in HIItemIndex index, in CollectionTag tag );        
  107.  
  108.  
  109.  
  110.     
  111.     #ifdef __SOMIDL__
  112.     implementation 
  113.     {
  114.         
  115.         passthru C_h =     "#include <HIImagingObjects.h>"
  116.                         "#include <HIListTypes.h>";
  117.         passthru C_xh =    "#include <HIImagingObjects.xh>"
  118.                         "#include <HIListTypes.h>";
  119.  
  120.         releaseorder:                InitAbstractList,
  121.                                     AddItems,
  122.                                     DeleteItem,
  123.                                     SetItemImage,
  124.                                     GetItemImage,
  125.                                     SetItemMark,
  126.                                     GetItemMark,
  127.                                     SetItemIcon,
  128.                                     GetItemIcon,
  129.                                     SetItemChild,
  130.                                     GetItemChild,
  131.                                     SetItemEnabledState,
  132.                                     GetItemEnabledState,
  133.                                     SetItemAttributes,
  134.                                     GetItemAttributes,
  135.                                     SetItemRefLabel,
  136.                                     GetItemRefLabel,
  137.                                     GetItemCount,
  138.                                     GetItemRect,
  139.                                     HitTest,
  140.                                     SelectItem,
  141.                                     DeselectItem,
  142.                                     GetSelectedItem,
  143.                                     AddItemCollectionItem,
  144.                                     GetItemCollectionItemData,
  145.                                     RemoveItemCollectionItem,
  146.                                     reserved0;
  147.     };
  148.     #endif
  149. };
  150.  
  151.  
  152. interface HIList : HIAbstractList
  153. {
  154. // ======================================================
  155. // Public Methods
  156. // ======================================================
  157.  
  158.     OSStatus InitList(    in RefLabel            identifier,
  159.                         in HIWindow         window, 
  160.                         in Rect             bounds,
  161.                         in HIItemStorage    itemStorage );    
  162.  
  163.  
  164.  
  165.     implementation 
  166.     {
  167.         passthru C_h =     "#include <HIItemStorage.h>";
  168.         passthru C_xh = "#include <HIItemStorage.xh>";
  169.  
  170.         
  171.         releaseorder:                InitList;
  172.     };
  173. };
  174.  
  175. interface HIMultipleSelectionList : HIList
  176. {
  177.     OSStatus InitMultipleSelectionList(    in RefLabel            identifier,
  178.                                         in HIWindow         window, 
  179.                                         in Rect             bounds,
  180.                                         in HIItemStorage    itemStorage );    
  181.  
  182.  
  183.  
  184.     OSStatus    SetItemSelectedState( in HIItemIndex index, in HIItemState selectedState );    
  185.     HIItemState    GetItemSelectedState( in HIItemIndex index );                                
  186.  
  187.  
  188.     OSStatus    GetSelectedItems( in UInt32 requestedCount, out UInt32 actualCount,
  189.                                     inout HIItemIndex indexArray );    
  190.     
  191.     
  192.  
  193.     implementation 
  194.     {
  195.         
  196.         releaseorder:                InitMultipleSelectionList,
  197.                                     SetItemSelectedState,
  198.                                     GetItemSelectedState,
  199.                                     GetSelectedItems;
  200.     };
  201. };
  202.  
  203.  
  204. interface HIMenu : HIAbstractList
  205. {
  206. // ======================================================
  207. // Public Methods
  208. // ======================================================
  209.  
  210.     OSStatus    InitMenu(    in RefLabel identifier );                
  211.  
  212.  
  213.     OSStatus    SetItemAccelerator( in HIItemIndex index, in UInt16 modifiers, in UInt16 accelerator );    
  214.     OSStatus    GetItemAccelerator( in HIItemIndex index, out UInt16 modifiers, out UInt16 accelerator );        
  215.  
  216.  
  217.     OSStatus    SetItemAppleEvent( in HIItemIndex index, in AppleEvent theEvent );    
  218.     OSStatus    GetItemAppleEvent( in HIItemIndex index, out AppleEvent theEvent );    
  219.  
  220.  
  221.     OSStatus    SetNextMenu( in HIMenu nextMenu );                                
  222.                 // For attaching one menu to another so they act like a single menu.
  223.     OSStatus    GetNextMenu( out HIMenu nextMenu );                                
  224.  
  225.  
  226.  
  227. // ======================================================
  228. // Procedural calls
  229. //     These are not object methods, but rather static functions
  230. // ======================================================
  231.  
  232.     void        SetRootHIMenu( in HIMenu rootMenuPanel );
  233.     HIMenu        GetRootHIMenu();
  234.  
  235.     void        SetMenuFlashCount( in UInt32 count );
  236.     UInt32        GetMenuFlashCount();
  237.     
  238.     
  239.     implementation 
  240.     {
  241.  
  242.         SetRootHIMenu:            procedure, noself;
  243.         GetRootHIMenu:            procedure, noself;
  244.         SetMenuFlashCount:        procedure, noself;
  245.         GetMenuFlashCount:        procedure, noself;
  246.         
  247.         releaseorder:                InitMenu,
  248.                                     SetItemAccelerator,
  249.                                     GetItemAccelerator,
  250.                                     SetItemAppleEvent,
  251.                                     GetItemAppleEvent,
  252.                                     SetNextMenu,
  253.                                     GetNextMenu,
  254.                                     GetMenuRef,
  255.                                     PopDown,
  256.                                     SetRootHIMenu,
  257.                                     GetRootHIMenu,
  258.                                     SetMenuFlashCount,
  259.                                     GetMenuFlashCount;
  260.     };
  261. };
  262.  
  263. #endif
  264.